<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>layui_User_查询</title>

    <!--layui的CSS样式-->
    <link type="text/css" rel="stylesheet" href="../lib/layuimini/lib/layui-v2.5.5/css/layui.css"/>
    <!--layui的js-->
    <script src="../lib/layuimini/lib/layui-v2.5.5/layui.js"></script>
    <!--第三方下拉表格js-->
    <script src="../lib/layuimini/js/lay-config.js"></script>

    <!--自己js的路径-->
    <script type="text/javascript" src="./js/SecurityStock.js"></script>

    <script type="text/javascript">

        // 通过值改变事件： 根据商品ID，获得价格
        function addsum(a){
            var unitCost= document.getElementById("unitCost").value
            var quantity= document.getElementById("quantity").value

                var sum=unitCost*quantity
                var money= document.getElementById("money").value=sum

        }


        // 通过值改变事件： 根据商品ID，获得价格
        function addsum1(a){
            var unitCost= document.getElementById("unitCost1").value
            var quantity= document.getElementById("quantity1").value

            var sum=unitCost*quantity
            var money= document.getElementById("money1").value=sum

        }

    </script>
</head>

<script type="text/html" id="toolEventDemo">
    <a class="layui-btn layui-btn-xs" style="background-color: #1E9FFF" lay-event="edit"><i
            class="layui-icon">&#xe642;</i>编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
            class="layui-icon">&#xe640;</i>删除</a>
</script>



<body>



<!--表格元素 lay-filter 通过这个属性来筛选绑定的表格-->
<table id="mytable" lay-filter="mytable"></table>

<!--上方工具条-->
<!--lay-event 是跟js的Switch case 后的名字一样的-->
<script type="text/html" id="userToolBar">
    <div style="float:right">
        <button class="layui-btn layui-btn-normal layui-btn layui-btn-sm" lay-event="add">
            <i class="layui-icon">&#xe654;</i>添加数据
        </button>
        <button class="layui-btn layui-btn-primary layui-btn layui-btn-sm" lay-event="deleteAll" style="color: #FF0000">
            <i class="layui-icon">&#xe640;</i>批量删除
        </button>
    </div>


    <!--  form表单  -->
    <!--   采用用户的名字来进行模糊查询-->
    <form class="layui-form layui-col-space5">
        <!--   采用用户的姓名和id来进行模糊查询-->

        <div class="layui-inline layui-show-xs-block">
        <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">证券名称</label>
        </div>
        <div class="layui-inline layui-show-xs-block">
            <input class="layui-input" autocomplete="off" placeholder="请输入证券名称" name="securityName" id="securityName">
        </div>

<!--        选择日期，没有写底层，只是写了日期框的组件-->
        <div class="layui-inline layui-show-xs-block">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">日期</label>
        </div>
        <div class="layui-inline layui-show-xs-block">
            <input autocomplete="off" class="layui-input dateStr3" lay-verify="date" name="date" id="date"
                   placeholder="请选择日期" type="text">
        </div>



        <!-- 模糊查询的按钮  -->
        <!-- type="button 这个是为了不让layui提交两次-->
        <div class="layui-inline layui-show-xs-block">
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-event="search"
                    lay-filter="sreach" type="button"><i class="layui-icon">&#xe615;</i>搜索
            </button>
        </div>
    </form>
</script>

<!--限制新增用户的时候用户输入的年龄 最小为1 最大为100岁 ：加了约束-->
<script type="text/javascript">
    function minmax(value, min, max)
    {
        if(parseInt(value) < min || isNaN(parseInt(value)))
            return min;
        else if(parseInt(value) > max)
            return max;
        else return value;
    }
</script>



<!--新增用户的窗口网页，删除，修改，一个模块就一个新的窗口网页好些，不需要通用-->
<div id="addWorkUser" style="width:100%;display: none;text-align: center;margin-top: 20px">
    <form id="addForm" class="layui-form layui-form-pane" style="display: inline-block" action="">

        <!--        日期框-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">日期</label>
            <div class="layui-input-inline">
                <input  type="text" autocomplete="off" class="layui-input dateStr1" lay-verify="date" name="date" placeholder="请输入日期">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">基金编号</label>
            <div class="layui-input-inline">
              <!--  <select name="fundId" id="fundId" lay-verify="required"  lay-search="">
                    <option value="159934">159934</option>
                    <option value="159935">159935</option>
                </select>-->
                  <!-- lay-verify  表单验证 required 必填-->
                  <input type="text" name="fundId" id="fundId1"
                         placeholder="请选择基金编号" autocomplete="off" class="layui-input">
            </div>
        </div>



        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">证券编号</label>
            <!--            这里的证券名称，不是文本框，是文本框里有个下拉表格
                            虽然这里是显示证券名称，但是还是是新增id，只是提示信息是输入证券名称罢了，再通过下拉表格选择证券-->
            <div class="layui-input-inline">
                <input type="text" name="securityId" id="securityId1" lay-verify="required"
                       placeholder="请选择证券编号" autocomplete="off" class="layui-input" >
            </div>
        </div>



        <!--<div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">证券编号</label>
            <div class="layui-input-inline">
                &lt;!&ndash; lay-verify  表单验证 required 必填&ndash;&gt;
                <input type="text" name="securityId" id="securityId1"
                       placeholder="证券编号" autocomplete="off" class="layui-input">
            </div>
        </div>-->



        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">单位成本</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="unitCost" id="unitCost"
                       placeholder="单位成本" autocomplete="off" onkeyup="addsum(this)" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">数量</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="quantity" id="quantity"
                       placeholder="数量" autocomplete="off" onkeyup="addsum(this)" class="layui-input">
            </div>
        </div>




        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">总金额</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="money" id="money"
                       placeholder="总金额" autocomplete="off" class="layui-input" readonly/>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray" >备注</label>
            <div class="layui-input-inline">

                <textarea name="Remark" required lay-verify="required" placeholder="备注" class="layui-textarea"></textarea>
            </div>
        </div>



        <div class="layui-form-item" style="position: relative;bottom: -30px">
            <button class="layui-btn"  style="background-color: #1E9FFF" lay-submit="" lay-filter="addWorkUser" >
                <i class="layui-icon">&#x1005;</i>添加
            </button>
            <button class="layui-btn layui-btn-primary" type="button" onclick="quxiao()" style="color: #FF0000">
                <i class="layui-icon">&#x1006;</i>取消
            </button>
        </div>
    </form>
</div>



<!--修改用户的窗口网页，删除，修改，一个模块就一个新的窗口网页好些，不需要通用-->
<!--<div id="updateWorkUser" style="width:100%;display: none;text-align: center;margin-top: 20px" >
    <form id="updateForm" class="layui-form layui-form-pane" lay-filter="myFrom2" action="">-->


        <div id="updateWorkUser" style="width:100%;display: none; text-align: center;margin-top: 20px">
            <form id="updateForm" class="layui-form layui-form-pane" lay-filter="myFrom2" style="display: inline-block" action="">



                <div class="layui-form-item" style="display: none">
                    <label class="layui-form-label layui-bg-gray">证券库存编号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="securityStockId" id="securityStockId"
                               placeholder="证券库存编号" autocomplete="off" class="layui-input" readonly="true">
                    </div>
                </div>

            <!--        日期框-->
        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray" style="width: 110px;text-align: center">日期</label>
            <div class="layui-input-inline">
                <input  type="text" autocomplete="off" class="layui-input dateStr2" lay-verify="ate" name="date" placeholder="请输入日期">
            </div>
        </div>

       <!-- <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">基金编号</label>
            <div class="layui-input-inline">
                <select name="fundId" id="fundId" lay-verify="required"  lay-search="">
                    <option value="159934">159934</option>
                    <option value="159935">159935</option>
                </select>
                &lt;!&ndash;  &lt;!&ndash; lay-verify  表单验证 required 必填&ndash;&gt;
                  <input type="text" name="fundId"
                         placeholder="基金编号" autocomplete="off" class="layui-input">&ndash;&gt;
            </div>
        </div>-->


      <!--  <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">证券编号</label>
            <div class="layui-input-inline">
                &lt;!&ndash; lay-verify  表单验证 required 必填&ndash;&gt;
                <input type="text" name="securityId"
                       placeholder="证券编号" autocomplete="off" class="layui-input">
            </div>
        </div>-->



        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">单位成本</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="unitCost" id="unitCost1"
                       placeholder="单位成本" autocomplete="off" onkeyup="addsum1(this)" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">数量</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="quantity" id="quantity1"
                       placeholder="数量" autocomplete="off" onkeyup="addsum1(this)" class="layui-input">
            </div>
        </div>




        <div class="layui-form-item">
            <label class="layui-form-label layui-bg-gray">总金额</label>
            <div class="layui-input-inline">
                <!-- lay-verify  表单验证 required 必填-->
                <input type="text" name="money" id="money1"
                       placeholder="总金额" autocomplete="off" class="layui-input" readonly/>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label  layui-bg-gray" >备注</label>
            <div class="layui-input-inline">

                <textarea name="remark" required lay-verify="required" placeholder="备注" class="layui-textarea"></textarea>
            </div>
        </div>



                <div class="layui-form-item" style="width:80%;margin-left: 10%;text-align: center;position: relative;bottom: -40px">
                    <!--            lay-filter="updateSysUser" 这里跟js里form.on submit()里的名字一样-->
                    <button class="layui-btn" style="background-color: #1E9FFF" lay-submit="" lay-filter="updateSecurityStock1" >
                        <i class="layui-icon">&#x1005;</i>修改
                    </button>
                    <button class="layui-btn layui-btn-primary" type="button" onclick="quxiao()" style="color: #FF0000">
                        <i class="layui-icon">&#x1006;</i>取消
                    </button>
                </div>
    </form>
</div>


</body>
</html>